package com.fh.shop.api.product.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
public class Product implements Serializable {
      private Long       id;             // 主键
      private String     productName;    //商品名
      private BigDecimal price;          //价格
      private Integer    stock;          //库存
      private String     mainImage;      //主图
      private Long       brandId;        //品牌id
      private Long       cate1;          //一级分类
      private Long       cate2;          //二级分类
      private Long       cate3;          //三级分类
      @DateTimeFormat(pattern = "yyyy-MM-dd")
      @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
      private Date       createDate;     //生产日期

      @TableField(exist = false)
      private String brandName; //品牌
      @TableField(exist = false)
      private String cateName; //分类

      private Integer status ;  // 0,1 状态
      private Integer recommend; //0,1
      private Integer newProduct; //0,1

      private Long sale; //销量

}
